package com.ve.utils;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ThreadPool {
    private static ThreadPool threadPool=new ThreadPool();
    ThreadPoolExecutor threadPoolExecutor;
    private ThreadPool(){
        threadPoolExecutor=new ThreadPoolExecutor(4,10,1, TimeUnit.MINUTES, new ArrayBlockingQueue<>(20));
    }
    public static void doThread(Runnable runnable){
        threadPool.threadPoolExecutor.execute(runnable);
    }

}
